﻿// JScript File



//作物长势监测模块
function loadGrowing()
{
    //清空div内所有的子元素element.
    if($('#wizard').children().length > 0)
    {
        $('#wizard').empty();
    }      
    
    //创建第一级div元素  
    var divMenu = document.createElement("div");
    divMenu.className = "basic";
    divMenu.id = "menuContent";
    divMenu.style.float = "left";
    
    //创建标题  
    var hrefTitle1 = document.createElement("a");
    var hrefTitle2 = document.createElement("a");
    var hrefTitle3 = document.createElement("a");
    var hrefTitle4 = document.createElement("a");
    
    var title1 = document.createTextNode("提取作物植被指数");
    var title2 = document.createTextNode("筛选敏感农学参数与植被指数");
    var title3 = document.createTextNode("建立长势监测模型");
    var title4 = document.createTextNode("长势分级与制图");
    
    hrefTitle1.appendChild(title1);
    hrefTitle2.appendChild(title2);
    hrefTitle3.appendChild(title3);
    hrefTitle4.appendChild(title4);

    
    //创建内容div元素 
    var modeltype="grow";
    if(USER_ROLE_INDEX.indexOf('0002') > -1) //判断用户是否具有高级权限（0001——查询； 0002——分析）
    { 
        var divContents1 = createRSIndexDiv(modeltype);//10-31日修改，添加参数
        var divContents2 = createParamRelateDiv();
        var divContents3 = createModelSelectDiv();
        var divContents4 = createDrawGrowingGraphDiv("长势分级");
        
        //添加标题和内容div到主div
        with($(divMenu))
        {
            append(hrefTitle1);
            append(divContents1);
            append(hrefTitle2);
            append(divContents2);
            append(hrefTitle3);
            append(divContents3);
            append(hrefTitle4);
            append(divContents4);
        }    
    }
    else
    {
        var divContents1 = createRSIndexDiv(modeltype);//10-31日修改，添加参数
        var divContents4 = createDrawGrowingGraphDiv();
        
        //添加标题和内容div到主div
        with($(divMenu))
        {
            append(hrefTitle1);
            append(divContents1);
//            append(hrefTitle2);
//            append(divContents2);
//            append(hrefTitle3);
//            append(divContents3);
            append(hrefTitle4);
            append(divContents4);
        }    
        
    }

    $("#wizard").append(divMenu);
    jQuery(divMenu).accordion(); 
      
}




//作物遥感单产估算流程**************************************************************************************
function loadRSUnitYeild()
{
    //清空div内所有的子元素element.
    if($('#wizard').children().length > 0)
    {
        $('#wizard').empty();
    }      
    
    //创建第一级div元素  
    var divMenu = document.createElement("div");
    divMenu.className = "basic";
    divMenu.id = "menuContent";
    divMenu.style.float = "left";
    
    
    //创建标题  
    var hrefTitle1 = document.createElement("a");
    var hrefTitle2 = document.createElement("a");
    var hrefTitle3 = document.createElement("a");
    var hrefTitle4 = document.createElement("a");
    //var hrefTitle5 = document.createElement("a");
    
    var title1 = document.createTextNode("提取作物植被指数");
    var title2 = document.createTextNode("筛选敏感农学参数与植被指数");
    var title3 = document.createTextNode("建立遥感单产模型");
    var title4 = document.createTextNode("单产分布制图与统计");
    //var title5 = document.createTextNode("分区县单产空间统计");

    hrefTitle1.appendChild(title1);
    hrefTitle2.appendChild(title2);
    hrefTitle3.appendChild(title3);
    hrefTitle4.appendChild(title4);
    //hrefTitle5.appendChild(title5);
    
    
    //创建内容div元素  
    var modeltype="rs";
    var divContent1 = createRSIndexDiv(modeltype);//10-31日修改，添加参数
    var divContent2 = createParamRelateDivForYeild();//11-3日修改这个方法
    var divContent3 = createModelSelectDiv();
    var divContent4 = createUnitYeildDiv();
    //var divContent5 = document.createElement("div");
    
    
    //添加标题和内容div到主div
    with($(divMenu))
    {
        append(hrefTitle1);
        append(divContent1);
        append(hrefTitle2);
        append(divContent2);
        append(hrefTitle3);
        append(divContent3);
        append(hrefTitle4);
        append(divContent4);
    }
    
    
    $("#wizard").append(divMenu);
    jQuery(divMenu).accordion(); 
      
}
//作物遥感单产估算流程**************************************************************************************

//作物农气单产估算流程
function loadAgriUnitYeild()
{
    //清空div内所有的子元素element.
    if($('#wizard').children().length > 0)
    {
        $('#wizard').empty();
    }      
    
    //创建第一级div元素  
    var divMenu = document.createElement("div");
    divMenu.className = "basic";
    divMenu.id = "menuContent";
    divMenu.style.float = "left";
    
    //创建标题  
    var hrefTitle1 = document.createElement("a");
    var hrefTitle2 = document.createElement("a");
    
    var title1 = document.createTextNode("模型参数提取与模型选择");
    var title2 = document.createTextNode("区县产量计算");

    hrefTitle1.appendChild(title1);
    hrefTitle2.appendChild(title2);
    
    
    //创建内容div元素  
    var divContent1 = createAgriModelSelectDiv();
    var divContent2 = createAgriCountyYeildDiv();
    
    
    //添加标题和内容div到主div
    with($(divMenu))
    {
        append(hrefTitle1);
        append(divContent1);
        append(hrefTitle2);
        append(divContent2);
    }
    
    
    $("#wizard").append(divMenu);
    jQuery(divMenu).accordion();     
}

//作物估产总产计算
function loadGrossYeild()
{
    //清空div内所有的子元素element.
    if($('#wizard').children().length > 0)
    {
        $('#wizard').empty();
    }      
    
    //创建第一级div元素  
    var divMenu = document.createElement("div");
    divMenu.className = "basic";
    divMenu.id = "menuContent";
    divMenu.style.float = "left";
    
    
    //创建标题  
    var hrefTitle1 = document.createElement("a");
    var hrefTitle2 = document.createElement("a");
    var hrefTitle3 = document.createElement("a");
//    var hrefTitle4 = document.createElement("a");
    //var hrefTitle5 = document.createElement("a");
    
    var title1 = document.createTextNode("遥感单产算总产");
    var title2 = document.createTextNode("农气单产算总产");
    var title3 = document.createTextNode("统计与分析");
//    var title4 = document.createTextNode("单产分布制图与统计");
    //var title5 = document.createTextNode("分区县单产空间统计");

    hrefTitle1.appendChild(title1);
    hrefTitle2.appendChild(title2);
    hrefTitle3.appendChild(title3);
//    hrefTitle4.appendChild(title4);
    //hrefTitle5.appendChild(title5);
    
    
    //创建内容div元素  
    var divContent1 = createRSUnit2GrossDiv();
    var divContent2 = createAgri2GrossDiv();
    var divContent3 = createGrossStatDiv();
//    var divContent4 = createUnitYeildDiv();
    //var divContent5 = document.createElement("div");
    
    
    //添加标题和内容div到主div
    with($(divMenu))
    {
        append(hrefTitle1);
        append(divContent1);
        append(hrefTitle2);
        append(divContent2);
        append(hrefTitle3);
        append(divContent3);
//        append(hrefTitle4);
//        append(divContent4);
    }
    
    
    $("#wizard").append(divMenu);
    jQuery(divMenu).accordion(); 
}

//品质趋势预报
function loadQuality()
{
    //清空div内所有的子元素element.
    if($('#wizard').children().length > 0)
    {
        $('#wizard').empty();
    }      
    
    //创建第一级div元素  
    var divMenu = document.createElement("div");
    divMenu.className = "basic";
    divMenu.id = "menuContent";
    divMenu.style.float = "left";
    
    //创建标题  
    var hrefTitle1 = document.createElement("a");
    //var hrefTitle2 = document.createElement("a");
    var hrefTitle5 = document.createElement("a");//11-12日添加
    var hrefTitle3 = document.createElement("a");
    var hrefTitle4 = document.createElement("a");
    
    var title1 = document.createTextNode("提取作物植被指数");
    //var title2 = document.createTextNode("筛选敏感农学参数与植被指数");
    var title5 = document.createTextNode("筛选敏感农学参数与植被指数");//11-12日添加
    var title3 = document.createTextNode("建立品质趋势预报模型");
    var title4 = document.createTextNode("品质预报分级与制图");
    
    hrefTitle1.appendChild(title1);
    //hrefTitle2.appendChild(title2);
    hrefTitle5.appendChild(title5);//11-12日添加
    hrefTitle3.appendChild(title3);
    hrefTitle4.appendChild(title4);

    
    //创建内容div元素 
    var modeltype="quality";
    if(USER_ROLE_INDEX.indexOf('0002') > -1) //判断用户是否具有高级权限（0001——查询； 0002——分析）
    { 
        var divContents1 = createRSIndexDiv(modeltype);//10-31日修改，添加参数
        //var divContents2 = createParamRelateDiv();
        var divContents5 = createParamRelateForQualityDiv();//11-12日添加，需要修改
        var divContents3 = createModelSelectDiv();
        var divContents4 = createDrawGrowingGraphDiv("品质预报分级");
        
        //添加标题和内容div到主div
        with($(divMenu))
        {
            append(hrefTitle1);
            append(divContents1);
            //append(hrefTitle2);
            //append(divContents2);
            append(hrefTitle5);//11-12日添加
            append(divContents5);//11-12日添加
            append(hrefTitle3);
            append(divContents3);
            append(hrefTitle4);
            append(divContents4);
        }    
    }
    else
    {
        var divContents1 = createRSIndexDiv(modeltype);//10-31日修改，添加参数
        var divContents4 = createDrawGrowingGraphDiv();
        
        //添加标题和内容div到主div
        with($(divMenu))
        {
            append(hrefTitle1);
            append(divContents1);
//            append(hrefTitle2);
//            append(divContents2);
//            append(hrefTitle3);
//            append(divContents3);
            append(hrefTitle4);
            append(divContents4);
        }    
        
    }

    $("#wizard").append(divMenu);
    jQuery(divMenu).accordion(); 
}

//品质遥感监测
function loadRSQuality()
{
    //清空div内所有的子元素element.
    if($('#wizard').children().length > 0)
    {
        $('#wizard').empty();
    }      
    
    //创建第一级div元素  
    var divMenu = document.createElement("div");
    divMenu.className = "basic";
    divMenu.id = "menuContent";
    divMenu.style.float = "left";
    
    //创建标题  
    var hrefTitle1 = document.createElement("a");
    var hrefTitle2 = document.createElement("a");

    var hrefTitle3 = document.createElement("a");
    var hrefTitle4 = document.createElement("a");
    
    var title1 = document.createTextNode("提取作物植被指数");
    var title2 = document.createTextNode("筛选品质指标与植被指数");
    var title3 = document.createTextNode("建立品质遥感模型");
    var title4 = document.createTextNode("品种遥感监测分级与制图");
    
    hrefTitle1.appendChild(title1);
    hrefTitle2.appendChild(title2);
    hrefTitle3.appendChild(title3);
    hrefTitle4.appendChild(title4);

    
    //创建内容div元素 
    var modeltype="Rsquality";
    if(USER_ROLE_INDEX.indexOf('0002') > -1) //判断用户是否具有高级权限（0001——查询； 0002——分析）
    { 
        var divContents1 = createRSIndexDiv(modeltype);//10-31日修改，添加参数
        var divContents2 = createParamRelateForRSQualityDiv();
        var divContents3 = createModelSelectDiv();//
        var divContents4 = createDrawGrowingGraphDiv("品质遥感监测");
        
        //添加标题和内容div到主div
        with($(divMenu))
        {
            append(hrefTitle1);
            append(divContents1);
            append(hrefTitle2);
            append(divContents2);
            append(hrefTitle3);
            append(divContents3);
            append(hrefTitle4);
            append(divContents4);
        }    
    }
    else
    {
        var divContents1 = createRSIndexDiv(modeltype);//10-31日修改，添加参数
        var divContents4 = createDrawGrowingGraphDiv();
        
        //添加标题和内容div到主div
        with($(divMenu))
        {
            append(hrefTitle1);
            append(divContents1);
            append(hrefTitle4);
            append(divContents4);
        }    
        
    }

    $("#wizard").append(divMenu);
    jQuery(divMenu).accordion(); 
}


//*********************************************************************灾害监测-病虫害（宫）*********************************************************************************
//作物病虫害监测模块
function loadDisease()
{
    //清空div内所有的子元素element.
    if($('#wizard').children().length > 0)
    {
        $('#wizard').empty();
    }
    $("#forData").data("dt","disease");      
    //创建第一级div元素  
    var divMenu = document.createElement("div");
    divMenu.className = "basic";
    divMenu.id = "menuContent";
    divMenu.style.float = "left";
    
    //创建标题  
    var hrefTitle1 = document.createElement("a");
    var hrefTitle2 = document.createElement("a");
    var hrefTitle3 = document.createElement("a");
    var hrefTitle4 = document.createElement("a");
    
    var title1 = document.createTextNode("提取作物植被指数");
    var title2 = document.createTextNode("筛选敏感农学参数与植被指数");
    var title3 = document.createTextNode("建立病虫害监测模型");
    var title4 = document.createTextNode("病虫害分级与制图");
    
    hrefTitle1.appendChild(title1);
    hrefTitle2.appendChild(title2);
    hrefTitle3.appendChild(title3);
    hrefTitle4.appendChild(title4);

    
    //创建内容div元素 
    if(USER_ROLE_INDEX.indexOf('0002') > -1) //判断用户是否具有高级权限（0001——查询； 0002——分析）
    { 
        var divContents1 = createRSIndexDiv_Disease();
        var divContents2 = createParamRelateDiv_Disease();
        var divContents3 = createModelSelectDiv_Disease();
        var divContents4 = createDrawGrowingGraphDiv_Disease();
        
        //添加标题和内容div到主div
        with($(divMenu))
        {
            append(hrefTitle1);
            append(divContents1);
            append(hrefTitle2);
            append(divContents2);
            append(hrefTitle3);
            append(divContents3);
            append(hrefTitle4);
            append(divContents4);
        }    
    }
    else
    {
        var divContents1 = createRSIndexDiv();
        var divContents4 = createDrawGrowingGraphDiv_Disease();
        
        //添加标题和内容div到主div
        with($(divMenu))
        {
            append(hrefTitle1);
            append(divContents1);
//            append(hrefTitle2);
//            append(divContents2);
//            append(hrefTitle3);
//            append(divContents3);
            append(hrefTitle4);
            append(divContents4);
        }    
        
    }

    $("#wizard").append(divMenu);
    jQuery(divMenu).accordion(); 
      
}
//*********************************************************************************************************************